//
//  SelectPayCardDetailTableViewCell.m
//  YTwallet
//
//  Created by ZhangLin on 2019/4/16.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "SelectPayCardDetailTableViewCell.h"
#import <Masonry.h>
@implementation SelectPayCardDetailTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupViews];
    }
    return self;
}
-(void)setupViews
{
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = ETTableViewLineColor;
    [self.contentView addSubview:self.lineView];
    
    self.bankImv = [[UIImageView alloc] init];
    self.bankImv.layer.cornerRadius = 10;
    self.bankImv.layer.masksToBounds = YES;
    [self.contentView addSubview:self.bankImv];
    
    
    self.banNameLab = [[UILabel alloc] init];
    self.banNameLab.font = [UIFont systemFontOfSize:14];
    self.banNameLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self.contentView addSubview:self.banNameLab];
    
    self.tailNumberLab = [[UILabel alloc] init];
    self.tailNumberLab.text = @"尾号(****)";
    self.tailNumberLab.font = [UIFont systemFontOfSize:14];
    self.tailNumberLab.textColor = ETColorWithRGB(153, 153, 153);
    [self.contentView addSubview:self.tailNumberLab];
    
    self.arrowImv = [[UIImageView alloc] init];
    self.arrowImv.image = [UIImage imageNamed:@"icon_choose_purple"];
    [self.contentView addSubview:self.arrowImv];
    
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    
    [self.bankImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
    }];
    
    
    [self.banNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.bankImv.mas_right).offset(20);
//        make.width.mas_equalTo(100);
        make.centerY.equalTo(self);;
    }];
    
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.banNameLab.mas_left);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(ETTableViewLineHeight);
        make.bottom.equalTo(self);
    }];
    
    [self.tailNumberLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.banNameLab.mas_right).offset(10);
        make.centerY.equalTo(self);
    }];
    
    [self.arrowImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.equalTo(self);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
